package org.tema.entities;

import static javax.persistence.GenerationType.AUTO;

import java.io.Serializable;
import java.lang.String;
import java.util.Set;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: UserGroup
 *
 */
@Entity
@Table(name="USERGROUP")
public class UserGroup implements Serializable {


	private int id;
	private String name;
	private String description;
	private static final long serialVersionUID = 1L;
	
	
	//relationship properties
	
	protected Set<User> userSet;



	public UserGroup() {
		super();
	}   
	
	@Id  
	@GeneratedValue(strategy=AUTO)
	@Column(name="ID")
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}   
	
	@Column(name="NAME")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	} 
	
	@Column(name="DESCRIPTION")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}


	//@ManyToMany(mappedBy="userGroups")
	@ManyToMany( cascade= {CascadeType.PERSIST, CascadeType.MERGE },mappedBy="userGroups")
	public Set<User> getUserSet() {
		return userSet;
	}

	
	public void setUserSet(Set<User> userSet) {
		this.userSet = userSet;
	}
   
}
